package com.by.controller;

import com.by.bean.ResultBean;

public class BaseController {
    final int SUCCESS=200;//成功返回码
    final int FAIL=0;//失败返回码
    protected ResultBean success(String msg){
        return process(SUCCESS,msg,null);
    }
    protected <T> ResultBean success(String msg, T data){
        return process(SUCCESS,msg,data);
    }
    protected ResultBean fail(String msg){
        return process(FAIL,msg,null);
    }
    <T> ResultBean  process(int code,String msg,T data){
        return new ResultBean(code,msg,data);
    }
}
